<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>选择器</title>
    <style>
        /*子孙后代选择器*/
        /*body div div p{
            color: papayawhip;
        }*/
        /*子元素选择器*/
        body > div > p {
            color: red;
        }
        /*伪类选择器*/
        a:link{color: red}/*未访问*/
        a:visited{color: yellow}/*访问过*/
        a:hover{color: blue}/*悬停*/
        a:active{color: green}/*点击、激活*/
    </style>
</head>
<body>
<a href="http://www.baidu.com">百度</a>
<a href="http://www.aqiyi.com">爱奇艺</a>
<a href="http://www.taobao.com">淘宝</a>
<p>p1</p>
<div>
    <p>p2</p>
    <div><p>p3</p></div>
    <div>
        <p>p4</p>
        <div><p>p5</p></div>
    </div>
</div>
</body>
</html>